// CinemaSystem.hpp
#ifndef CINEMASYSTEM_HPP
#define CINEMASYSTEM_HPP

#include <iostream>
#include <string>
#include <vector>
#include "map"
#include <regex>
#include <fstream>
#include <sstream>


class CinemaSystem {
public:
    enum class SeatStatus {
        AVAILABLE,
        SOLD
    };

    struct Seat;
    struct Auditorium;
    std::string readDateFromScreen();
    void saveAuditoriumsToFile( const std::string& filename);
    std::vector<CinemaSystem::Auditorium> readAuditoriumsFromFile(const std::string& filename);
    Seat readseat(int seat_info,int aud_info);
    void sale(int sit_info,int Auditorium);
    CinemaSystem(const std::string& date, const std::string& name, double price);
    void addAuditorium(const Auditorium& hall);
    std::vector<Auditorium> halls;
    void d1elete(const std::string& filePath);
private:

};

struct CinemaSystem::Seat {
    int rowNumber;
    int columnNumber;
    std::string seatID;
    SeatStatus status;
    Seat(int row, int col);
    Seat();  //默认构造函数
};

struct CinemaSystem::Auditorium {
    std::map<std::string, std::pair<std::string, double>> movie;  // <Date, <MovieName, TicketPrice>>
    int hallNumber;            //放映厅的序号

    double ticketPrice;
    std::vector<Seat> seats;      //放映厅的座位排布（1维数组）
    Auditorium( int numSeats,int number);
};



#endif // CINEMASYSTEM_HPP
